const {
    request
} = require('./request')
module.exports = {
    // 首页轮播图
    getlist: (data) => {
        return request('banner/list', 'GET', data)
    },
    // 分类列表
    Fen: () => {
        return request('shop/goods/category/all', 'GET')
    },
    // 最新公告
    NewG: () => {
        return request('notice/last-one', 'GET')
    },
    // 商品列表
    Erecom: (data) => {
        return request('shop/goods/list/v2', 'POST', data)

    },
    // 商品详情
    Detail: (data) => {
        return request('shop/goods/detail', 'GET', data)
    },
    //检验商品是否收藏
    Collection: (data) => {
        return request('shop/goods/fav/check', 'GET', data)
    },
    // 添加商品收藏
    CollectionAdd: (data) => {
        return request('shop/goods/fav/add', 'POST', data)
    },
    // 删除商品收藏
    CollectionDel: (data) => {
        return request('shop/goods/fav/delete', 'POST', data)
    },
    // 收藏列表
    CollectionList: (data) => {
        return request('shop/goods/fav/list/v2', 'POST', data)
    },
    //检测token是否过期的api
    checkTokenApi(token) {
        return request('user/check-token', 'GET', {
            token
        })
    },
    //封装自动注册和登录接口方法
    autoRegAndLoginApi(code) {
        return request('user/wxapp/authorize', 'POST', {
            code: code
        })
    },
    //获取用户详情api
    getUserDetailApi(token) {
        return request('user/detail', 'GET', {
            token
        })
    },
    //更新用户信息api
    updateUserInfoApi(data = {}) {
        return request('user/modify', 'POST', data)
    },
    // 加入购物车
    GoShop(data = {}) {
        return request('shopping-cart/add', 'POST', data)
    },
    //  获取商品配件
    PeiShop(data) {
        return request('shop/goods/goodsAddition', 'GET', data)
    },
    // 购物车列表
    ShopList: (data) => {
        return request('shopping-cart/info', 'GET', data)
    },
    // 购物车修改选中状态
    ShopCheck: (data) => {
        return request('shopping-cart/select', 'POST', data)
    },
    // 删除购物车
    ShopDel: (data) => {
        return request('shopping-cart/remove', 'POST', data)
    },
    // 修改购物车数量
    ShopChange: (data) => {
        return request('shopping-cart/modifyNumber', 'POST', data)
    },
    // 商品价格
    ShopPrice: (data) => {
        return request('shop/goods/price', 'POST', data)
    },


}